<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <p>123</p>
    <p>456</p>
    <p>789</p>

    <script>
        let name = "tom";
        let age = 12;
        let person = {
            name,
            age,
            info(){
                //this就是指person
                console.log(this.name,this.age);
                
            }
        }
        console.log(person);
        person.info();

        let stu = {id:'001',name:'张三',age:29};
        let classInfo = {cid:'c06',cname:'开发6',num:30}
        //... 拓展运算符实现对象的合并
        let stuInfo = {...stu,...classInfo}
        console.log(stuInfo);
        //Object.assign 实现对象合并
        Object.assign(stu,classInfo);
        console.log(stu);
        
        let arr=[1,2,3];
        console.log(arr.length);
        //console.log(1=="1");
        //console.log(1==="1");
        
        var ps = document.getElementsByTagName("p");
        console.log(ps.length);
        let ary = Array.from(ps);
        ary.push("hello")
        console.log(ary);

        let aar = Array.from([1,2,3],x=>x*3+2);
       console.log(aar);
       
        

    </script>
</body>

</html>